package com.example.doublecache.controller;

import com.example.doublecache.entity.AlgorithmInfo;
import com.example.doublecache.service.AlgorithmService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/api/algorithm")
public class AlgorithmController {
    
    @Autowired
    private AlgorithmService algorithmService;
    
    @GetMapping("/{id}")
    public AlgorithmInfo getAlgorithm(@PathVariable String id) {
        return algorithmService.getAlgorithm(id);
    }
    
    @PutMapping
    public void updateAlgorithm(@RequestBody AlgorithmInfo info) {
        algorithmService.updateAlgorithm(info);
    }
} 